package com.sc.nft.admin.request;


import com.fasterxml.jackson.annotation.JsonFormat;
import com.sc.nft.entity.dto.ActivityTaskDTO;
import com.sc.nft.enums.PrizeDrawActivityPoolBonusTaypEnum;
import com.sc.nft.enums.PrizeDrawActivityTypeEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.Valid;
import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@Data
public class AddCarveUpActivityRequest {

    @ApiModelProperty(value = "活动名称")
    @NotNull(message = "活动名称不能为空")
    @Length(min = 1, max = 10, message = "最大长度为10个汉字")
    private String nameActivity;

    @ApiModelProperty(value = "道具名称")
    @NotNull(message = "道具名称不能为空")
    private String propName;

    @ApiModelProperty(value = "开始时间")
    @NotNull(message = "开始时间不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date startTime;

    @ApiModelProperty(value = "结束时间")
    @NotNull(message = "结束时间不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date endTime;


    @ApiModelProperty(value = "排序,由大到小")
    @NotNull(message = "排序不能为空")
    private Integer sort;

    @ApiModelProperty(value = "封面图片")
    @NotNull(message = "封面图片不能为空")
    private String coverImg;

    @ApiModelProperty(value = "规则图片")
    @NotNull(message = "规则图片不能为空")
    private String ruleImg;

    @ApiModelProperty(value = "道具id")
    @NotNull(message = "道具不能为空")
    private Long propId;

    @ApiModelProperty(value = "类型 GUESSING_ACTIVITY:竞猜活动 PARTITION_ACTIVITY:瓜分活动")
    @NotNull(message = "类型不能为空")
    private PrizeDrawActivityTypeEnum type;

    @ApiModelProperty(value = "奖池预留(百分比)")
    @NotNull(message = "奖池预留不能为空")
    @DecimalMin(value = "0", inclusive = true,message = "奖池预留必须大于等于0")
    @DecimalMax(value = "100.0",message = "奖池预留必须小于等于100")
    private BigDecimal prizePoolReserve;

    @ApiModelProperty(value = "初始奖金")
    @NotNull(message = "初始奖金不能为空")
    @DecimalMin(value = "0.1", inclusive = false,message = "初始奖金范围不正确")
    @DecimalMax(value = "1000000000.0",message = "初始奖金范围不正确")
    private BigDecimal initPoolReserve;

    @ApiModelProperty(value = "奖金类型 PLATFORM_LAUNCH:平台首发 SECONDARY_MARKET:二级市场  IP_MALL:IP商城")
    @NotNull(message = "奖金类型不能为空")
    private PrizeDrawActivityPoolBonusTaypEnum bonusType;

    @ApiModelProperty(value = "奖励配置")
    @NotNull(message = "奖励配置不能为空")
    private List<AddPrizeDrawActivityRewardsRequest> prizeDrawActivityRewardsRequestList;

    @ApiModelProperty("任务配置")
    private List<@Valid ActivityTaskDTO> activityTasks;
}
